import { defineStore } from "pinia";
import { Subject } from "rxjs";
import { _global } from ".";

export const useRuleStore = defineStore("rule", {
  state: () => {
    return {
      //卡片命名规则
      materialNameRule: "",
      materialNamePrefix: "",
      materialNameSuffix: "",
      propertyNameRule: "",
      propertyNamePrefix: "",
      propertyNameSuffix: "",
      partsNameRule: "",
      partsNamePrefix: "",
      partsNameSuffix: "",
      assembliesNameRule: "",
      assembliesNamePrefix: "",
      assembliesNameSuffix: "",
    };
  },
  actions: {
    setMaterialNameRule(v: any) {
      this.materialNameRule = v;
    },
    setMaterialNamePrefix(v: any) {
      this.materialNamePrefix = v;
    },
    setMaterialNameSuffix(v: any) {
      this.materialNameSuffix = v;
    },
    setPropertyNameRule(v: any) {
      this.propertyNameRule = v;
    },
    setPropertyNamePrefix(v: any) {
      this.propertyNamePrefix = v;
    },
    setPropertyNameSuffix(v: any) {
      this.propertyNameSuffix = v;
    },
    setPartsNameRule(v: any) {
      this.partsNameRule = v;
    },
    setPartsNamePrefix(v: any) {
      this.partsNamePrefix = v;
    },
    setPartsNameSuffix(v: any) {
      this.partsNameSuffix = v;
    },
    setAssembliesNameRule(v: any) {
      this.assembliesNameRule = v;
    },
    setAssembliesNamePrefix(v: any) {
      this.assembliesNamePrefix = v;
    },
    setAssembliesNameSuffix(v: any) {
      this.assembliesNameSuffix = v;
    },
  },
});
